---@class UIDarkStreetReward : UIBase
UIDarkStreetReward = UIBase.New(PanelResNames.UIDarkStreetReward)
local t = UIDarkStreetReward

function t.Init()
    UIBase.Init(t)
end

function t:OnCreate()
    self.Btn_Reward = self:GetChild("Btn_Reward")
    self.Btn_Confirm = self:GetChild("Btn_Confirm")
    self.Text_RewardLimit = self:GetChild("Text_RewardLimit")
    self:RegisterOnClick(self.Btn_Confirm,self.ClickSure)
end

function t:OnEnable()
    AudioManager.Play(28)
    self:Refresh()
end
function t:OnDisable()
end
function t:OnDestroy()
end
function t:Refresh()
    local ctrl = logicMgr.CtrlManager.GetCtrl(PanelNames.Item)
    local count = logicMgr.DarkStreetMgr.resultData.realGetMoney
    ctrl.initData(self.Btn_Reward,{itemModelId = logicMgr.DarkStreetMgr.resItemModelId,num = count})
    local a1,a2,a3,limit = logicMgr.DarkStreetMgr.GetWeekLimitData()
    self.Text_RewardLimit.text = string.format(getLanguage("DarkLaneTipes_15"),DarkStreetMgr.battleBeforeResCount+count,limit)
end
function t:ClickSure()
    closeUI(PanelNames.UIDarkStreetReward)
    RedRob.ClientBattle.Leave()
    UISpeed()
end
return t